import * as React from "react";
import { createRoot } from "react-dom/client";
import {
  createBrowserRouter,
  RouterProvider,
  Route,
  Link,
  Navigate,
} from "react-router-dom";
import Home from "../pages/Home";
import BoxManagement from "../pages/BoxManagement";
import SnackManagement from "../pages/SnackManagement";
import Orders from "../pages/Orders";
import User from "../pages/User/User";
import Login from "../pages/Login/Login";
import Register from "../pages/Register/Register";
import Settings from "../pages/Settings/Settings";
import UserCard from "@/pages/UserCard/UserCard";
import NotFound from "@/pages/404/NoFound";
import Grid from "@/components/grid/Grid";
import SnackOrder from "@/pages/SnackOrder/SnackOrder";
import Payment from "@/pages/Payment/Payment";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Navigate to="/home" />,
  },
  {
    path: "/home",
    element: <Grid />,
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: "boxes",
        element: <BoxManagement />,
      },
      {
        path: "manage",
        element: <SnackManagement />,
      },
      {
        path: "orders",
        element: <Orders />,
      },
      {
        path: "user",
        element: <User />,
      },
      
    ],
  },
  {
    path: "/*",
    element: <NotFound />,
  },
  {
    path: "/login",
    element: <Login />,
  },
  {
    path: "/register",
    element: <Register />,
  },
  {
    path: "/settings",
    element: <Settings />,
  },
  {
    path: "about",
    element: <div>About</div>,
  },
  {
    path: "usercard",
    element: <UserCard />,
  },
  {
    path: "snackorder",
    element: <SnackOrder />,
  },
  {
    path:'payment',
    element:<Payment/>
  }
]);
export default router;
